package com.miyake.loveviewweb.client.viewer;

import com.miyake.loveviewweb.client.main.UiDataHandler;
import com.miyake.loveviewweb.shared.model.ChartModel;
import com.miyake.loveviewweb.shared.model.DataModel;
import com.miyake.loveviewweb.shared.model.FolderModel;


public class ViewerFactory {
    private static ViewerFactory instance;

    private ViewerFactory() {
        
    }
    
    public static ViewerFactory getInstance() {
        if (instance == null) {
            instance = new ViewerFactory();
        }
        return instance;
    }
    
    public Viewer createFolderViewer(FolderModel folderModel, UiDataHandler uiHandler) {
        return new FolderViewer(folderModel, uiHandler);
    }
    
    public Viewer createChartViewer(ChartModel chartModel, UiDataHandler uiHandler) {
        return new ChartViewer(chartModel);
    }

    public Viewer createDataViewer(DataModel dataModel, UiDataHandler uiHandler) {
        return new DataViewer(dataModel, uiHandler);
    }
}
